<?php

namespace App\Events;

use Illuminate\Broadcasting\Channel;
use Illuminate\Queue\SerializesModels;
use Illuminate\Broadcasting\PrivateChannel;
use Illuminate\Broadcasting\PresenceChannel;
use Illuminate\Foundation\Events\Dispatchable;
use Illuminate\Broadcasting\InteractsWithSockets;
use Illuminate\Contracts\Broadcasting\ShouldBroadcast;
use Illuminate\Support\Facades\Event;

class PushUserLogEvent
{
    use Dispatchable,InteractsWithSockets,SerializesModels;

    public $user_id;
    public $type;
    public $operation;
    public $before;
    public $after;
    public $remark;
    public $staff_ip;
    public $staff_id;

    /**
     * Create a new event instance.
     *
     * @return void
     */
    public function __construct($type, $user, $operation, $before, $after , $remark , $staff)
    {
        $this->type = $type;
        $this->user_id = $user['id'];
        $this->operation = $operation;
        $this->before= $before;
        $this->after= $after;
        $this->remark = $remark;
        $this->staff_ip = $staff['last_visited_ip'];
        $this->staff_id = $staff['id'];
    }

    /**
     * Get the channels the event should broadcast on.
     *
     * @return \Illuminate\Broadcasting\Channel|array
     */
    public function broadcastOn()
    {
        return [];
    }
}
